﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace UserInterface.Views
{
    using Events;

    /// <summary>
    /// Interaction logic for DeclearWar.xaml
    /// </summary>
    public partial class DeclearWar : UserControl
    {
        public DeclearWar()
        {
            InitializeComponent();
        }

        public event EventHandler<DeclearWarEventArgs> DeclearWarHandler;
        private void OnDeclearWar(uint id)
        {
            if (this.DeclearWarHandler != null)
                this.DeclearWarHandler(this, new DeclearWarEventArgs(id));
        }

        private void Act_Click(object sender, RoutedEventArgs e)
        {
            if (listBox.SelectedItem != null)
                this.OnDeclearWar(this.GetSelectedID());
        }

        private uint GetSelectedID()
        {
            return (uint) listBox.SelectedValue ;
        }
    }
}
